package ecnu.ecgbackend.controller;

import ecnu.ecgbackend.service.DiagnosisCommonService;
import ecnu.ecgbackend.utils.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/common")
public class DiagnosisCommonController {
    @Resource
    DiagnosisCommonService diagnosisCommonService;

    @PostMapping("/code")//这是注册时的手机号
    public Result sendCode(String phone){
        return diagnosisCommonService.sendCode(phone);
    }

    @PostMapping("/verify/code")//忘记密码的验证码必须用自己的注册手机号
    public Result sendVerifyCode(String username,String phone){
        return diagnosisCommonService.sendVerifyCode(username,phone);
    }
    @PostMapping("/verify")
    public Result verify(String phone,String code){
        return  diagnosisCommonService.verify(phone,code);
    }


}
